home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Tools & Apps / Networking & Communications / N & C MacsBug Macros⁄Templates / Read Me 1.2 < prev   
Encoding:
Text File  |  1992-02-07  |  5.2 KB  |  137 lines  |  [TEXT/ttxt]

  1. N & C MacsBug Macros/Templates
  2. v1.2
  3.  
  4. Changes from v1.1 to v1.2:
  5. • Added driver number check to the .XPP and .DSP Driver 'mxbm' resources.
  6. You no longer have to compare for the driver number yourself.
  7. • Changed the documentation to reflect the changes.
  8.  
  9. Changes from v1.0 to v1.1:
  10. • Added some extra parenthesis to the macros so you can add additional
  11. conditions.
  12. • Fixed a couple of macros in the .MPP Driver 'mxbm' resource.
  13. • Fixed some templates in the PPC ParamBlocks 'mxwt' resource.
  14.  
  15. This ResEdit file contains MacsBug 'mxbm' and 'mxwt' for the .MPP, .ATP, 
  16. .XPP, and .DSP AppleTalk drivers and for the PPC Toolbox.  Add these 
  17. resources to MacsBug's Debugger Prefs file and you'll be able to easily 
  18. trap on AppleTalk driver control calls and PPC Toolbox calls and you'll 
  19. also be able to dump the parameter blocks and associated data structures 
  20. used by those calls.
  21.  
  22. After adding the resources to the Debugger Prefs file and rebooting, you 
  23. can get a list of the macros with MacsBug's MCD (list macros) command 
  24. and a list of the templates with MacsBug's TMP (list templates) command.  
  25. Here's a short explanation of what you get with each resource.
  26.  
  27.  
  28. The .MPP Driver 'mxbm' Resource
  29.  
  30. These macros let you trap on any call to the .MPP driver with MacsBug's 
  31. ATB command.  Since the .MPP driver always uses the same dRef number 
  32. ($fff6), these macros match on both the dRef number (passed in ioRefNum) 
  33. and the csCode in the parameter block passed to _Control.  For example, 
  34. the LookupName macro expands to:
  35.  
  36.      †Control ((ra0+18)^=fff600fb)
  37.  
  38. so an example using the LookupName macro to trap on NBP LookupName calls 
  39. would be:
  40.  
  41.      ATB LookupName
  42.  
  43.  
  44. The .ATP Driver 'mxbm' Resource
  45.  
  46. These macros let you trap on any call to the .ATP driver with MacsBug's 
  47. ATB command.  Since the .ATB driver always uses the same dRef number 
  48. ($fff5), these macros match on both the dRef number (passed in ioRefNum) 
  49. and the csCode in the parameter block passed to _Control.
  50.  
  51.  
  52. The .XPP Driver 'mxbm' Resource
  53.  
  54. These macros let you trap on any call to the .XPP driver with MacsBug's 
  55. ATB command.  Since the .XPP driver always uses the same dRef number 
  56. ($ffd7), these macros match on both the dRef number (passed in ioRefNum) 
  57. and the csCode in the parameter block passed to _Control.
  58.  
  59. The .DSP Driver 'mxbm' Resource
  60.  
  61. These macros let you trap on any call to the .DSP driver with MacsBug's 
  62. ATB command.  Since the .DSP driver does not always use the same dRef 
  63. number, these macros match only on the csCode in the parameter block 
  64. passed to _Control.  This means you'll have to add your own additional 
  65. expression to match on the dRef number.  You can get the dRef number of 
  66. the .DSP driver with the MacsBug DRVR dcmd.
  67.  
  68. Assuming you got the .DSP driver's dRef number (using the DRVR dsmd) 
  69. and it is $ffcc, here's how you could use the dspOpen macro:
  70.  
  71.      ATB (dspOpen) & ((ra0+18)^.w=ffcc.w)
  72.  
  73. The PPC Toolbox 'mxbm' Resource
  74.  
  75. These macros let you trap on any call to the PPC Toolbox with MacsBug's 
  76. ATB command.  Since some PPC Toolbox calls can be made both 
  77. synchronously or asynchronously, there are two macros for those calls 
  78. (for example: PPCOpenSync and PPCOpenAsync).
  79.  
  80. The 'mxwt' Template Resources
  81.  
  82. These templates let you display AppleTalk and PPC Toolbox parameter 
  83. blocks and their associated data structures the way you'd probably want 
  84. to see them.
  85.  
  86. The resource titled "AppleTalk Types" must be included in the Debugger 
  87. Prefs file to use the MPP, ATP, XPP, DSP, or PPC ParamBlocks resources.  
  88. That's because the other templates build on templates defined in 
  89. AppleTalk Types.
  90.  
  91. Here's an example of what you'll see using one of the templates 
  92. (LookupNameParm):
  93.  
  94.      DM RA0 LookupNameParm
  95.  
  96.       Displaying LookupNameParm at 000B8E6C
  97.        000B8E6C  MPPParamBlock      
  98.        000B8E6C    qLink            NIL
  99.        000B8E70    qType            0002 
  100.        000B8E72    ioTrap           A004 
  101.        000B8E74    ioCmdAddr        000BB110 ->  
  102.        000B8E78    ioCompletion     NIL 
  103.        000B8E7C    ioResult         0000 
  104.        000B8E7E    ioNamePtr        2000FFFF is a bad pointer 
  105.        000B8E82    ioVRefNum        FFFF 
  106.        000B8E84    ioRefNum         FFF6 
  107.        000B8E86    csCode           00FB  
  108.        000B8E88  interval           07 
  109.        000B8E89  count              05 
  110.        000B8E8A  entityPtr          000B8EAA -> 
  111.        000B8EAA    objStr           "=" 
  112.        000B8EAC    typeStr          "AFPServer" 
  113.        000B8EB6    zoneStr          "*"  
  114.        000B8E8E  retBuffPtr         000BD108 ->  
  115.        000B8E92  retBuffSize        0400 
  116.        000B8E94  maxToGet           0100 
  117.        000B8E96  numGotten          0000 
  118.  
  119. You can use the templates along with the macros to trap on a call and 
  120. then display the parameter block passed to that call.  For example:
  121.  
  122.      ATB LookupName ';DM RA0 LookupNameParm'
  123.  
  124. will trap on LookupName and then display the parameter block passed to 
  125. LookupName (pointed to by RA0).
  126.  
  127.  
  128. Conclusion
  129.  
  130. I knocked these macros and templates out late at night and I haven't had 
  131. a chance to use everyone of them, so there may be a few mistakes.  If 
  132. you find anything wrong, or have any good ideas how I can improve 
  133. anything, just send me a Link at MACDTS.
  134.  
  135. Jim Luther
  136. Apple Developer Technical Support
  137.